package com.demo.gulimall.product.controller;

import com.demo.gulimall.common.utils.R;
import com.demo.gulimall.product.mapper.SkuSaleAttrValueMapper;
import com.demo.gulimall.product.service.SkuSaleAttrValueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author Chen Yuan
 * @create 2023-06-19  16:51
 */
@RestController
@RequestMapping("/product/skusaleattr")
public class SkuSaleAttrValueController {

	@Autowired
	private SkuSaleAttrValueMapper skuSaleAttrValueMapper;

	@GetMapping("/stringlist/{skuId}")
	public R<List<String>> getSkuSaleAttrValuesBySkuId(@PathVariable("skuId") Long skuId){
		List<String> attrValues = skuSaleAttrValueMapper.selectSkuSaleAttrValuesAsStringList(skuId);

		return R.ok(attrValues);
	}
}
